# -*- coding:utf-8 -*-
import pymysql.cursors

class Storage():
    """存储信息"""
    #__conn = None
    def __init__(self):
        self.__conn = pymysql.connect(
            host = '127.0.0.1',
            user = 'root',
            password = 'sql4415',
            db = 'story',
            charset = 'utf8mb4',
            cursorclass = pymysql.cursors.DictCursor
        )
    def get_mysql(self,info):

        try:
            with self.__conn.cursor() as cursor:
                cursor.executemany("insert into content(title,text) values (%s,%s)",info)
                self.__conn.commit()
                return True
        except:
            return False